<?php
/**
 * 
 *机器人自动砍价/拼团
 *
 * @copyright  Copyright (c) 中国追溯
 * @since      File available since Release v1.1
 */

use Shopnc\Tpl;
defined('InShopNC') or exit('Access Invalid!');

class kanjiaControl extends SystemControl{
    public function __construct(){
        parent::__construct();
    }
    /**
     * 活动列表
     */
    public function indexOp(){
    	$status=false;
    	if($_POST){
    		$save=array("robot"=>$_POST['robot1'],"robot_time"=>$_POST['robot_time1']);
    		$status1=Model("kanjia")->saveConfig($save,"id = 1")?true:false;
    		$save=array("robot"=>$_POST['robot2'],"robot_time"=>$_POST['robot_time2']);
    		$status2=Model("kanjia")->saveConfig($save,"id = 2")?true:false;
    		if($status1||$status2){
    			$status=1;
    		}
    	}
		$config=Model("kanjia")->getConfig();
		Tpl::output('status', $status);
		Tpl::output('config', $config);
        Tpl::showpage('kanjia.index'); 
    }
  }